# 登录
import requests

# 请求参数
data = {
    "accounts": "hu2374145",
    "pwd": "hu2374145",
    "verify": "",
    "type": "username"
}

# 写法1
# url = "http://shop-xo.hctestedu.com/index.php?s=api/user/login"
# res = requests.post(
#     url='http://shop-xo.hctestedu.com/index.php?s=api/user/login&application=app&application_client_type=weixin',
#     json=data)
# print(res.text)

# 写法2
# 加了&符号，都可以通过公共参数来传递
paramsData = {
    "application": "app",
    "application_client_type": "weixin"
}
res = requests.post(url="http://shop-xo.hctestedu.com/index.php?s=api/user/login", params=paramsData, json=data)
print(res.text)


